package com.zxlspace.collection2;

import java.util.ArrayList;
import java.util.List;

public class TestApp {
    public static void main(String[] args) {
        List<String> list = new ArrayList<String>();

//        A<Fruit> fruitA = new A<Apple>();  泛型没有多态
        A<Fruit> f = new A<Fruit>();
//        test(A<Apple>);
        Animal<Student> animal = new Cat<Student>();

    }

    public static void test(A<Fruit> fruit) {  //形参使用多态

    }

    public static A<Fruit> test1(Fruit fruit) { //返回类型使用多态
//        return new A<Apple>();
        return new A<Fruit>();
    }

}

class Animal<T> {

}

class Cat<T> extends Animal<T>{

}
